package com.daidai.app;

import com.daidai.config.SpringConfig;
import com.daidai.dao.UserDao;
import com.daidai.dao.impl.UserDaoImpl;
import com.daidai.domain.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class App1 {
    public static void main(String[] args) {

        ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class);
        UserDaoImpl userDao = (UserDaoImpl) context.getBean(UserDao.class);

        User user = userDao.findAllUserById(2);
        System.out.println(user);

//        User insertUser = new User();
//        insertUser.setUsername("wangwu");
//        insertUser.setPassword("123123");
//        userDao.insert(insertUser);
        userDao.delete(5);


    }
}
